package org.example.Server.controller.home;

import lombok.extern.slf4j.Slf4j;
import org.example.Server.service.CommenEnumService;
import org.example.Server.utils.ResultAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/youxich/home")
public class CommenEnumController {
    @Autowired
    CommenEnumService commenEnumService;

    /**
     * 获得试卷方向
     *
     * @return
     */
    @GetMapping("/direction")
    public ResultAPI getDirectionLsit() {
        return commenEnumService.getDirectionLsit();
    }

    /**
     * 获取试题知识点
     *
     * @return
     */
    @GetMapping("/qspoint")
    public ResultAPI getQspoint(@RequestParam(required = false) Integer direction_id) {
        return commenEnumService.getQspoint(direction_id);
    }

    /**
     * 获取首页功能以及介绍
     * @return
     */
    @GetMapping("/function")
    public ResultAPI getFunction() {
        return commenEnumService.getFunction();
    }
}
